package com.yetm.controller;

import com.yetm.domain.Account;
import com.yetm.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/account")
public class AccountController {

    @Autowired
    AccountService accountService;

    @GetMapping(value = "/allAccount", produces = "text/html;charset=UTF-8")
    @ResponseBody
    public String getAllAccount() {
        List<Account> allAccount = accountService.getAllAccount();
        System.out.println(allAccount);
        return "success";
    }
}
